import { parseCookie } from "src/assets/utils";
import { fetchOutSourceList } from "src/assets/fetch";

export async function getOutSourceList(context, { cookie, param }) {
  if (typeof cookie === "string") {
    cookie = parseCookie(cookie);
  }
  const res = await fetchOutSourceList(param, cookie.string);
  context.commit("setDemands", {
    userid: cookie.data.userid,
    type: param.reqType,
    list: res.data,
  });
  return res;
}
